package com.cnpc.framework.base.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.cnpc.framework.annotation.ForeignShow;
import com.cnpc.framework.annotation.Header;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.Date;
import java.util.List;

@Entity
@Table(name = "tbl_dict")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" })
public class Dict extends BaseEntity {

    private static final long serialVersionUID = 5569761987303812150L;

    @ForeignShow
    @Header(name = "字典名称")
    @Column(name = "name", length = 200)
    private String name;

    @Header(name = "唯一编码")
    @Column(name = "code", length = 200)
    private String code;

    @Header(name = "字典值")
    @Column(name = "value", length = 200)
    private String value;

    @Header(name = "字典值")
    @Column(name = "valuex", length = 200)
    private String valuex;

    @Header(name = "字典值")
    @Column(name = "valuey", length = 200)
    private String valuey;

    @Header(name = "经度")
    @Column(name = "locX")
    private String locx;


    @Header(name = "纬度")
    @Column(name = "locY")
    private String locy;

    @Header(name = "地址")
    @Column(name = "address")
    private String address;

    @Header(name = "父级ID")
    @Column(name = "parent_id")
    private String parentId;

    @Header(name = "层级编码")
    @Column(name = "levelCode", length = 36)
    private String levelCode;

    //@Column(name = "remark", length = 10000)
    @Header(name = "备注")
    @Column(name = "remark")
    private String remark;

    @Header(name = "图片")
    @Column(name = "img")
    private String img;

    @Transient
    private String parentName;

    @Transient
    private Date curTime;

    @Transient
    private List<Dict> children;

    public String getParentName() {

        return parentName;
    }

    public void setParentName(String parentName) {

        this.parentName = parentName;
    }

    public String getName() {

        return name;
    }

    public void setName(String name) {

        this.name = name;
    }

    public String getCode() {

        return code;
    }

    public void setCode(String code) {

        this.code = code;
    }

    public String getValue() {

        return value;
    }

    public void setValue(String value) {

        this.value = value;
    }

    public String getLevelCode() {

        return levelCode;
    }

    public void setLevelCode(String levelCode) {

        this.levelCode = levelCode;
    }

    public String getRemark() {

        return remark;
    }

    public void setRemark(String remark) {

        this.remark = remark;
    }

    public String getParentId() {

        return parentId;
    }

    public void setParentId(String parentId) {

        this.parentId = parentId;
    }

    public List<Dict> getChildren() {
        return children;
    }

    public void setChildren(List<Dict> children) {
        this.children = children;
    }

    public String getLocx() {
        return locx;
    }

    public void setLocx(String locx) {
        this.locx = locx;
    }

    public String getLocy() {
        return locy;
    }

    public void setLocy(String locy) {
        this.locy = locy;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getValuex() {
        return valuex;
    }

    public void setValuex(String valuex) {
        this.valuex = valuex;
    }

    public Date getCutTime() {
        return curTime;
    }

    public void setCutTime(Date cutTime) {
        this.curTime = cutTime;
    }

    public String getValuey() {
        return valuey;
    }

    public void setValuey(String valuey) {
        this.valuey = valuey;
    }

    @Override
    public String toString() {
        return "Dict{" +
                "name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", value='" + value + '\'' +
                ", locx='" + locx + '\'' +
                ", locy='" + locy + '\'' +
                ", parentId='" + parentId + '\'' +
                ", levelCode='" + levelCode + '\'' +
                ", remark='" + remark + '\'' +
                ", parentName='" + parentName + '\'' +
                ", children=" + children +
                '}';
    }



}
